/*
 * @Author: liujm
 * @Date: 2022-10-11 13:14:08
 * @Description: file content
 */
import common from '@/api/interface-urls/common';
import { getDatas, postData } from '../data-source/commonRequestApi';

class LoginService {
  /**
   * 登录
   * @param {Object} data 登录信息
   */
  login = (data) => postData(common.LOGIN, data);

  /**
   * 获取ticket
   * @param {String} uid 发起人uid
   * @param {String} targetClientId 目标方clientId
   */
  getTicket = (uid, targetClientId) => getDatas(common.GET_TICKET, { uid, targetClientId });

  /**
   * 单点登录
   * @param {String} ticket 单点服务参数ticket
   */
  ssoLogin = (ticket) => getDatas(common.SSO_URL, { ticket });
}

export default LoginService;
